home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Dev
/
Obrn-A_1.6_lib.lha
/
oberon-a
/
source3.lha
/
source
/
EAGUI
/
EADialogs.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
5KB
|
201 lines
(*************************************************************************
$RCSfile: EADialogs.mod $
Description: Implements a GUI for OCPrefs using EAGUI.library.
Created by: fjc (Frank Copeland)
$Revision: 1.1 $
$Author: fjc $
$Date: 1995/06/04 23:20:25 $
Copyright © 1995, Frank Copeland
This module forms part of the OC program
See OCPrefs.doc for conditions of use and distribution
Log entries are at the end of the file.
*************************************************************************)
<* STANDARD- *> <* MAIN- *>
MODULE EADialogs;
IMPORT
SYS := SYSTEM, s := Sets, e := Exec, u := Utility, i := Intuition,
gt := GadTools, ea := EAGUI, spt := EASupport, Events,
ip := IntuiPointer;
(* ---------------------------------- *)
TYPE
EADialog * = POINTER TO EADialogRec;
EADialogRec * = RECORD (Events.GadToolsPortRec)
winObj - : ea.OPTR;
win - : i.WindowPtr;
gadList - : i.GadgetPtr;
visualInfo - : gt.VisualInfo;
drawInfo - : i.DrawInfoPtr;
title * : e.LSTRPTR;
flags * : s.SET32;
IDCMP * : s.SET32;
busyReq : i.RequesterPtr;
END; (* EADialogRec *)
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) SetupWindow* ( win : i.WindowPtr );
BEGIN (* SetupWindow *)
dlg.AttachPort (win.userPort);
spt.DoRender ( dlg.win, dlg.winObj, dlg.gadList,
dlg.drawInfo, dlg.visualInfo )
END SetupWindow;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) CleanupWindow* ( win : i.WindowPtr );
VAR ignore : LONGINT;
BEGIN (* CleanupWindow *)
ignore := i.RemoveGList ( dlg.win, dlg.gadList, -1 );
ea.FreeGadgetList ( dlg.winObj, dlg.gadList );
dlg.gadList := NIL;
dlg.DetachPort
END CleanupWindow;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) HandleRefreshWindow*
( msg : i.IntuiMessagePtr )
: INTEGER;
BEGIN (* HandleRefreshWindow *)
gt.ReplyIMsg (msg);
gt.BeginRefresh (dlg.win);
gt.EndRefresh (dlg.win, i.LTRUE);
RETURN Events.Continue
END HandleRefreshWindow;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) HandleCloseWindow*
( msg : i.IntuiMessagePtr )
: INTEGER;
BEGIN (* HandleCloseWindow *)
gt.ReplyIMsg (msg);
RETURN Events.Stop
END HandleCloseWindow;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) InitObjects* () : BOOLEAN;
<*$ < ReturnChk- *>
BEGIN
HALT (99);
END InitObjects;
<*$ > *>
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) OpenWindow* () : BOOLEAN;
VAR
w, h, bl, br, bt, bb, ignore : LONGINT;
wPtr, hPtr, blPtr, brPtr, btPtr, bbPtr : SYS.ADDRESS;
BEGIN (* OpenWindow *)
(* obtain the minimum dimensions of every object in the tree *)
ea.GetMinSizes (dlg.winObj);
(* get some attributes *)
wPtr := SYS.ADR (w); hPtr := SYS.ADR (h);
blPtr := SYS.ADR (bl); brPtr := SYS.ADR (br);
btPtr := SYS.ADR (bt); bbPtr := SYS.ADR (bb);
ignore := ea.GetAttrs ( dlg.winObj,
ea.MinWidth, wPtr,
ea.MinHeight, hPtr,
ea.BorderLeft, blPtr,
ea.BorderRight, brPtr,
ea.BorderTop, btPtr,
ea.BorderBottom, bbPtr,
u.done );
(* open the window *)
dlg.win := i.OpenWindowTagsA ( NIL,
i.waTitle, dlg.title,
i.waFlags, dlg.flags,
i.waIDCMP, dlg.IDCMP,
i.waInnerHeight, h + bt + bb,
i.waInnerWidth, (w + bl + br),
u.done );
RETURN (dlg.win # NIL)
END OpenWindow;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) Block*;
BEGIN (* Block *)
IF dlg.busyReq = NIL THEN
NEW (dlg.busyReq);
IF dlg.busyReq # NIL THEN
ip.Busy (dlg.win);
i.InitRequester (dlg.busyReq^);
IF ~i.Request (dlg.busyReq, dlg.win) THEN
SYS.DISPOSE (dlg.busyReq);
dlg.busyReq := NIL
END
END
END
END Block;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) UnBlock*;
BEGIN (* UnBlock *)
IF dlg.busyReq # NIL THEN
i.EndRequest (dlg.busyReq, dlg.win);
ip.Normal (dlg.win);
SYS.DISPOSE (dlg.busyReq);
dlg.busyReq := NIL
END
END UnBlock;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) Open*
( visualInfo : gt.VisualInfo;
drawInfo : i.DrawInfoPtr )
: BOOLEAN;
BEGIN (* Open *)
dlg.visualInfo := visualInfo;
dlg.drawInfo := drawInfo;
IF dlg.InitObjects() THEN
IF dlg.OpenWindow() THEN
dlg.SetupWindow (dlg.win);
RETURN TRUE
END;
END;
RETURN FALSE
END Open;
(* ---------------------------------- *)
PROCEDURE (dlg : EADialog) Close*;
BEGIN (* Close *)
dlg.UnBlock;
dlg.CleanupWindow (dlg.win);
i.CloseWindow (dlg.win); dlg.win := NIL;
ea.DisposeObject (dlg.winObj); dlg.winObj := NIL
END Close;
END EADialogs.
(*************************************************************************
$Log: EADialogs.mod $
# Revision 1.1 1995/06/04 23:20:25 fjc
# - Release 1.6
#
*************************************************************************)